Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
| foreach ($calendars as $calendar) { | ||
| if (method_exists($calendar, 'isDeleted') && $calendar->isDeleted()) { | ||
| continue; | ||
| } | ||
|
|
||
| $results = $calendar->search('', [], ['uid' => $uid], 1); | ||
| if (!empty($results)) { | ||
| $result = $results[0]; | ||
| $objectUri = $result['uri']; | ||
| $calendarUri = $calendar->getUri(); | ||
|
|
||
| // Construct the DAV path that matches what the frontend uses for objectId | ||
| $davPath = '/remote.php/dav/calendars/' . $this->userId . '/' . $calendarUri . '/' . $objectUri; | ||
| $objectId = base64_encode($davPath); | ||
|
|
||
| $editRecurrenceId = $recurrenceId ?? 'next'; | ||
|
|
||
| return new RedirectResponse( | ||
| $this->urlGenerator->linkToRoute('calendar.view.indexdirect.edit.recurrenceId', [ | ||
| 'objectId' => $objectId, | ||
| 'recurrenceId' => $editRecurrenceId, | ||
| ]) | ||
| ); | ||
| } |
There was a problem hiding this comment.
should be maybe moved to a service, so it can be reused by #8048
Signed-off-by: Hamza <hamzamahjoubi221@gmail.com>
|
Also wondering if we should implement a method to search by event UID |
| // Events | ||
| ['name' => 'event#index', 'url' => '/event/{uid}', 'verb' => 'GET', 'postfix' => 'event.uid'], | ||
| ['name' => 'event#index', 'url' => '/event/{uid}/{recurrenceId}', 'verb' => 'GET', 'postfix' => 'event.uid.recurrenceId'], |
There was a problem hiding this comment.
I would make this a generic route "/object/{uid}" or something like that, this way this can be used for both Events and Tasks
There was a problem hiding this comment.
Also can we use the new route attributes instead of the routes file?
There was a problem hiding this comment.
I never worked with tasks, would they also use the same logic to resolve/ redirect ?
There was a problem hiding this comment.
Yes, VTODO (tasks) are identical for the most part to a VEVENT, they have a UID and a RECURRANCE-ID, the main differences are VTODO does not have a DTEND it uses a DUE and DURATION.
There was a problem hiding this comment.
Makes sense, I'll update it then
| * @NoAdminRequired | ||
| * @NoCSRFRequired |
There was a problem hiding this comment.
Please use the new route attributes
| private CalendarInitialStateService $calendarInitialStateService, | ||
| private IManager $calendarManager, | ||
| private IURLGenerator $urlGenerator, | ||
| private ?string $userId, |
There was a problem hiding this comment.
Use a userSession
| if ($this->userId === null) { | ||
| $this->calendarInitialStateService->run(); | ||
| return new TemplateResponse($this->appName, 'main'); | ||
| } |
add a way to share a permanent link to an event

ps: Set as a fix intentionally so it can be backported